﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using log4net;
using FB.Utilities;

namespace FB.admin
{
    public partial class AdminIndex : System.Web.UI.Page
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(_Default).Name);
        protected void Page_Load(object sender, EventArgs e)
        {
            CheckPermission();
            log.Error("Go to administrator page");
        }

        private void CheckPermission()
        {
            if (Page.User.IsInRole(Constants.ROLE_ADMINISTRATOR)
                || Page.User.IsInRole(Constants.ROLE_AUTHOR)
                || Page.User.IsInRole(Constants.ROLE_CONTRIBUTER)
                || Page.User.IsInRole(Constants.ROLE_EDITOR))
            {
                //
            }
            else
            {
                Response.Redirect("/admin/AccessDenied.aspx");
            }
        }
    }
}